/*
 * Created by 2006-7-6 下午09:10:39
 * $Id: Album163Manager.java 86 2006-07-10 15:41:18Z wjx $
 */
package com.someok.service.photo.service;

import org.hibernate.criterion.Restrictions;

import com.someok.base.common.BaseDAOSupport;
import com.someok.service.photo.domain.Album163;

/**
 * 
 * <p><a href="Album163Manager.java.html"><i>View Source</i></a></p>
 *
 * @author wjx
 * @version $Revision: 86 $ $Date: 2006-07-10 23:41:18 +0800 (星期一, 10 七月 2006) $
 */
public class Album163Manager extends BaseDAOSupport {
	protected Class getEntityClass() {
		return Album163.class;
	}

	public int deleteAlbumBy163Id(String album163Id) {

		String delHql = "delete Album163 where album163Id = :albumId";
		int i = getSession().createQuery(delHql).setString("albumId",
				album163Id).executeUpdate();

		logger.debug("delete album num is " + i);
		return i;

	}

	public int deleteAll() {

		String delHql = "delete Album163";
		int i = getSession().createQuery(delHql).executeUpdate();

		logger.debug("delete album num is " + i);
		return i;

	}

	public Album163 getAlbumBy163Id(String album163Id) {

		return (Album163) getSession().createCriteria(Album163.class).add(
				Restrictions.eq("album163Id", album163Id)).uniqueResult();

	}
}
